![]() |
GetThreadCurrentTaskRef |
||||
Header: | Threads.h | Carbon status: | Supported | |
Obtains a thread task reference.
OSErr GetThreadCurrentTaskRef ( ThreadTaskRef *threadTRef );
On return, a pointer to a thread task reference.
A result code.
The thread task reference is somewhat of a misnomer because it identifies your application context, not a particular thread. Identifying your application context is necessary in situations where you arenít guaranteed that your application is the current contextósuch as during the execution of an interrupt function. In such cases, you need both the thread ID to identify the thread and the thread task reference to identify the application context.
After you obtain the thread task reference, you can use it in the GetThreadStateGivenTaskRef and SetThreadReadyGivenTaskRef functions to get and set information about specific threads in your application at times when you are not guaranteed that your application is the current context.
To get information about a thread when your application is not the current process, use the GetThreadStateGivenTaskRef function.
To change the state of a thread from stopped to ready when your application is not the current process, use the SetThreadReadyGivenTaskRef function.
Supported in Carbon. Available in CarbonLib 1.0 and later when ThreadsLib 1.0 or later is installed. Exported by CarbonLib 1.0 and later and by ThreadsLib 1.0 and later.
© 2000 Apple Computer, Inc. — (Last Updated 3/8/2000)